not equal

how would you do a "not equal" equation

for example, if you want an if state for if x is equal to y in java or dxl:

if (x = y)

or

if (x == y)

now I want to write an if statement for if x is NOT EQUAL to y, then do this. in java, it is usually:

if (x != y)

but this doesn't seem to be it for dxl. what is the symbol for "not equal"?
phan423 - Mon Feb 06 14:50:33 EST 2012

Re: not equal
llandale - Mon Feb 06 15:07:44 EST 2012

void Test(int x, y)
{  if (x != y) //
   then print x "\t" y "\tare NOT equal\n"
   else print x "\t" y "\tare     equal\n"
}
Test(2,2)
Test(2,3)


Perhaps you had other syntax issues.

-Louie

Re: not equal
SystemAdmin - Mon Feb 06 15:22:03 EST 2012

DXL uses "!=" for the Not Equal operator as well, and the basic statement if (x != y) is syntactically valid for DXL..... but, oh so many questions!

What data types are you assigning to x and y?

What is the exact DXL error message that you are receiving?

Can you show us more of the DXL code that you're writing as this could be a forward or backward error that you're experiencing?


Paul Miller
Melbourne, Australia

Re: not equal
phan423 - Mon Feb 06 18:05:14 EST 2012

actually nvm... it works! i could have sworn it didn't work for the longest time. thought maybe the operator was "not" or something else since the "&&" is "and" in dxl. thanks for the help though

Re: not equal
TheRat - Sat Oct 25 07:58:31 EDT 2014

phan423 - Mon Feb 06 18:05:14 EST 2012
actually nvm... it works! i could have sworn it didn't work for the longest time. thought maybe the operator was "not" or something else since the "&&" is "and" in dxl. thanks for the help though

Have a look at DXL "EQUAL" AND "NOT EQUAL" OPERATORS FAILURE.

The problem you encountered may have been due to this bug when the LHS is a reference variable.